# -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from django.db import models

SEX = (
    ('男', '男'),
    ('女', '女'),
    )

RELATION = (
    ('父亲', '父亲'),
    ('母亲', '母亲'),
    ('其他', '其他'),
    )

class UserProfile(models.Model):
    user = models.OneToOneField(User, unique=True)
    date = models.DateTimeField(auto_now_add=True, verbose_name='注册时间')
    name = models.CharField(max_length=20, verbose_name='孩子姓名')
    sex = models.CharField(max_length=2, choices=SEX, verbose_name='孩子性别')
    birthday = models.DateField(verbose_name='孩子出生日期')
    parent_name = models.CharField(max_length=20, verbose_name='家长姓名')
    parent_relation = models.CharField(max_length=4, choices=RELATION, verbose_name='与孩子的关系')
    company = models.CharField(max_length=100, null=True, blank=True, verbose_name='工作单位')
    phone = models.CharField(max_length=20, verbose_name='手机号码')
    address = models.CharField(max_length=100,null=True,blank=True, verbose_name='联络地址')
    zipcode = models.CharField(max_length=10, null=True, blank=True, verbose_name='邮政编码')
    email = models.EmailField(verbose_name='Email 地址')
    nursery = models.CharField(max_length=100, null=True, blank=True, verbose_name='在读托儿所名称')

CENTER = (
    ('暂无', '暂无'),
    )

CLASS = (
    ('宝宝豆', '宝宝豆'), 
    ('幼儿豆', '幼儿豆'), 
    ('跑跑豆', '跑跑豆'), 
    ('体操豆', '体操豆'), 
)

class PracticeReservation(models.Model):
    date = models.DateTimeField(auto_now_add=True, verbose_name='登记时间')
    name = models.CharField(max_length=20, verbose_name='孩子姓名')
    sex = models.CharField(max_length=2, choices=SEX, verbose_name='孩子性别', default='男')
    birthday = models.DateField(verbose_name='孩子出生日期', help_text='<p style="line-height:3px">日期格式：2008-8-8</p>')
    parent_name = models.CharField(max_length=20, verbose_name='家长姓名')
    parent_relation = models.CharField(max_length=4, choices=RELATION, verbose_name='与孩子的关系', default='父亲')
    phone = models.CharField(max_length=20, verbose_name='手机号码')
    email = models.EmailField(verbose_name='Email 地址')
    company = models.CharField(max_length=100, null=True, blank=True, verbose_name='工作单位')
    address = models.CharField(max_length=100, null=True, blank=True, verbose_name='联络地址')
    zipcode = models.CharField(max_length=10, null=True, blank=True, verbose_name='邮政编码')
    nursery = models.CharField(max_length=100, null=True, blank=True, verbose_name='在读托儿所名称')
    center = models.CharField(max_length=100, choices=CENTER, verbose_name='选择最近中心', default='暂无')
    classes = models.CharField(max_length=100, choices=CLASS, verbose_name='选择预约课程', default='宝宝豆')
    processed = models.BooleanField(verbose_name='是否已经处理', default=False)

class FriendLink(models.Model):
    date = models.DateTimeField(auto_now_add=True, verbose_name='加入时间')
    link = models.CharField(max_length=255, null=False, blank=False, verbose_name='链接')
    display_name = models.CharField(max_length=20, null=False, blank=False, verbose_name='显示内容')
    is_display = models.BooleanField(verbose_name='是否显示', default=True)

